#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QLabel>
#include <QUdpSocket>
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;

    QLabel *LabSocketState;
    QUdpSocket *udpSocket;
    QString getLocalIP();   //获取本机IP

private slots:
    void onSocketStateChange(QAbstractSocket::SocketState socketState);
    void onSocketReadyRead();       //读取socket传入数据
    void on_actStart_triggered();
    void on_actStop_triggered();
    void on_btnSend_clicked();
    void on_btnBroadcast_clicked();
    void on_pushButton_clicked();
};

#endif // MAINWINDOW_H
